import {createSlice} from '@reduxjs/toolkit';

export interface IPageState {
    list: string[];
    current: string;
}

const initialState: IPageState = {
    list: [],
    current: '',
};

export const pageSlice = createSlice({
    name: 'page',
    initialState,
    reducers: {
        _activateThisPage(state, action) {
            state.current = action.payload;
        },
        _addPage(state) {
            state.list.push('');
        },
        _deleteThisPage() {},
    },
});

export const {_activateThisPage, _addPage} = pageSlice.actions;

export default pageSlice.reducer;
